from django.db import models
# Create your models here.


class Users(models.Model):
    id = models.AutoField(primary_key=True)
    user_name = models.CharField(max_length=64)
    birth_date = models.DateField(auto_now_add=True)


class Chirping(models.Model):
    id = models.AutoField(primary_key=True)
    text = models.CharField(max_length=1024)
    timestamp = models.CharField(max_length=32, unique=True)
    score = models.IntegerField(default=0)


class Chirping_comment(models.Model):
    id = models.AutoField(primary_key=True)
    text = models.CharField(max_length=1024)
    timestamp = models.CharField(max_length=32)
    chirping_timestamp = models.ForeignKey(
            'Chirping', to_field='timestamp', on_delete=models.CASCADE)
    score = models.IntegerField(default=0)


class Pref(models.Model):
    id = models.AutoField(primary_key=True)
    ip = models.CharField(max_length=1024)
    timestamp = models.CharField(max_length=32)
    desc = models.CharField(max_length=1024)
    val = models.CharField(max_length=1024)
